package com.mini.test.netty;

import static org.jboss.netty.channel.Channels.pipeline;

import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;

public class ServerPipeLineFactory implements ChannelPipelineFactory {

	@Override
	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline piple = pipeline();
		piple.addLast("decoder", new StringDecoder());
		piple.addLast("encoder", new StringEncoder());
		
		piple.addLast("handler", new ServerHandler());
		
		return piple;
	}

}
